<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:doc="livcos.org/ns/doc"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns="http://www.w3.org/1999/XSL/Format"
  exclude-result-prefixes="doc xs">

  <xsl:template match="doc:history">
    <table table-layout="fixed" width="100%" font-size="9pt" font-family="sans-serif"
      space-before.optimum="20cm" space-start.optimum="10cm" space-after.minimum="0.5cm" >
      <table-column column-width="24%"/>
      <table-column column-width="10%"/>
      <table-column column-width="66%"/>
      <table-header font-weight="bold">
        <table-row>
          <table-cell padding="2pt">
            <block>
              <xsl:text>Datum</xsl:text>
            </block>
          </table-cell>
          <table-cell padding="2pt">
            <block text-align="center">
              <xsl:text>Author</xsl:text>
            </block>
          </table-cell>
          <table-cell padding="2pt">
            <block>
              <xsl:text>Bemerkungen</xsl:text>
            </block>
          </table-cell>
        </table-row>
      </table-header>
      <table-body>
        <xsl:apply-templates select="doc:record">
          <xsl:sort select="@time" order="descending"/>
        </xsl:apply-templates>
      </table-body>
    </table>
    <block></block>
  </xsl:template>

  <xsl:template match="doc:record">
    <table-row>
      <table-cell padding="2pt">
        <block>
        <xsl:value-of
          select="format-dateTime(xs:dateTime(@time), '[D01].[M01].[Y01] [H01]:[m01]:[s01]')"/>
        </block>
      </table-cell>
      <table-cell padding="2pt">
        <block text-align="center">
          <xsl:value-of select="@author" />
        </block>
      </table-cell>
      <table-cell padding="2pt">
        <block>
          <xsl:value-of select="doc:description"/>
        </block>
      </table-cell>
    </table-row>
  </xsl:template>
  
</xsl:stylesheet>
